import java.io.File;
import java.io.IOException;

public class Demo8 {
    public static void main(String[] args) throws IOException {
        File srcFile = new File("./abc1234/def");
        File destFile = new File("./def");
        srcFile.createNewFile();
        boolean ok = srcFile.renameTo(destFile);//将srcFile的名字改为destFile,
        System.out.println(ok);
    }
}